unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
  SynEdit, SynHighlighterPas, SynHighlighterCpp, SynHighlighterPython,
  SynExportHTML, SynHighlighterHTML, IpHtml;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    IpHtmlPanel1: TIpHtmlPanel;
    SynCppSyn1: TSynCppSyn;
    SynEdit1: TSynEdit;
    SynExporterHTML1: TSynExporterHTML;
    SynHTMLSyn1: TSynHTMLSyn;
    SynPasSyn1: TSynPasSyn;
    SynPythonSyn1: TSynPythonSyn;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private

  public

  end;

var
  Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  SynEdit1.Highlighter:=SynPasSyn1;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  SynExporterHTML1.ExportAll(SynEdit1.Lines);
  SynExporterHTML1.SaveToFile('1.html');
end;

procedure TForm1.Button3Click(Sender: TObject);
var
  fs : TStringStream;
  pHTML : TIpHtml;
begin
  fs:=TStringStream.Create(SynEdit1.Lines.Text);
  pHTML:=TIpHtml.Create;
  pHTML.LoadFromStream(fs);
  IpHtmlPanel1.SetHtml(pHTML);

end;

initialization
  {$I unit1.lrs}

end.

